package game.classes;

import java.awt.Graphics;

/**
 * @author Chris
 */
public abstract class GameObject {

    protected static int GODOWN = 1;
    protected static int GOUP = -1;
    private int px;
    private int py;
    private Sprite sprite;

    public GameObject(String sp, int x, int y) {
        px = x;
        py = y;
        sprite = SpriteFactory.get().getSprite(sp);
    }

    protected final Sprite getSprite() {
        return sprite;
    }

    protected final int getX() {
        return px;
    }

    protected final void setX(int x) {
        px = x;
    }

    protected final int getY() {
        return py;
    }

    protected final void setY(int y) {
        py = y;
    }

    protected void moveTo(int x, int y) {
        setX(x);
        setY(y);
    }

    public void draw(Graphics g) {
        sprite.draw(g, this.px, this.py);
    }
}
